package com.qj.yantaishan.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;
import com.qj.yantaishan.mapper.OrderDiscountMapper;
import com.qj.yantaishan.domain.OrderDiscount;
import com.qj.yantaishan.service.IOrderDiscountService;
import com.qj.yantaishan.common.core.text.Convert;

/**
 * 订单折扣Service业务层处理
 * 
 * @author qihe
 * @date 2022-07-22
 */
@Service
@Primary
public class OrderDiscountServiceImpl    extends ServiceImpl<OrderDiscountMapper, OrderDiscount>  implements IOrderDiscountService
{
    @Autowired
    private OrderDiscountMapper orderDiscountMapper;

    /**
     * 查询订单折扣
     * 
     * @param id 订单折扣主键
     * @return 订单折扣
     */
    @Override
    public OrderDiscount selectOrderDiscountById(Long id)
    {
        return orderDiscountMapper.selectOrderDiscountById(id);
    }

    /**
     * 查询订单折扣列表
     * 
     * @param orderDiscount 订单折扣
     * @return 订单折扣
     */
    @Override
    public List<OrderDiscount> selectOrderDiscountList(OrderDiscount orderDiscount)
    {
        return orderDiscountMapper.selectOrderDiscountList(orderDiscount);
    }

    /**
     * 新增订单折扣
     * 
     * @param orderDiscount 订单折扣
     * @return 结果
     */
    @Override
    public int insertOrderDiscount(OrderDiscount orderDiscount)
    {
        return orderDiscountMapper.insertOrderDiscount(orderDiscount);
    }

    /**
     * 修改订单折扣
     * 
     * @param orderDiscount 订单折扣
     * @return 结果
     */
    @Override
    public int updateOrderDiscount(OrderDiscount orderDiscount)
    {
        return orderDiscountMapper.updateOrderDiscount(orderDiscount);
    }

    /**
     * 批量删除订单折扣
     * 
     * @param ids 需要删除的订单折扣主键
     * @return 结果
     */
    @Override
    public int deleteOrderDiscountByIds(String ids)
    {
        return orderDiscountMapper.deleteOrderDiscountByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除订单折扣信息
     * 
     * @param id 订单折扣主键
     * @return 结果
     */
    @Override
    public int deleteOrderDiscountById(Long id)
    {
        return orderDiscountMapper.deleteOrderDiscountById(id);
    }
}
